package com.iterator.mapper.wechat.lyh;

import com.iterator.bean.web.pojo.zql.CouponUser;
import com.iterator.bean.wechat.lyh.WxCouponMyVO;
import com.iterator.bean.wechat.lyh.WxCouponVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WxCouponMapper {
    List<WxCouponVO> selectCouponListByStatusAndDeleted(@Param("status") int status,
                                                        @Param("deleted") boolean deleted);

    List<WxCouponMyVO> selectMyCouponLByStatusAndDeleted(@Param("username") String username,
                                                         @Param("status") Integer status,
                                                         @Param("deleted") boolean deleted);

    //grouponRulesId暂不使用
    List<WxCouponMyVO> selectByUsernameCartIdGrouponRulesId(@Param("username") String username,
                                                            @Param("cartId") Integer cartId,
                                                            @Param("grouponRulesId") Integer grouponRulesId,
                                                            @Param("deleted") boolean deleted);

    //查询用户是否还可以继续
    Integer selectUserReceiveCouponNumber(@Param("username") String username,
                                          @Param("couponId") Integer couponId);

    Integer selectUserIdByUsername(@Param("username") String username);

    void insertUserCoupon1(@Param("couponUser") CouponUser couponUser);

    void insertUserCoupon2(@Param("couponUser") CouponUser couponUser);

    void timingRefreshInvalidCoupon();

    void timingRefreshInvalidUserCoupon();

    void timingRefreshInvalidUserOrder();
}
